package com.parking.carsystem.parkingchargesystem.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;


import com.parking.carsystem.parkingchargesystem.fragment.FragmentFactory;

import java.util.ArrayList;

/**
 * Created by Administrator on 2017/10/25 0025.
 */

public class MyCustomPagerAdapter extends FragmentStatePagerAdapter {
    ArrayList<String> mTitleText;

    public MyCustomPagerAdapter(FragmentManager fm, ArrayList<String> titleText) {
        super(fm);
        mTitleText = titleText;
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.getFragmentInsance(position);
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        //设置表头的title
        return mTitleText.get(position);
    }
}
